package com.tiantianyuegou.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * 
 *@Title:自动计算高度的gridview
 *@Description:
 *@Author:trouble
 *@Since:2015-9-1
 *@Version:1.1.0
 */
public class NoScrollGridView extends GridView {
	public NoScrollGridView(Context context) {
		this(context, null);
	}

	public NoScrollGridView(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	public NoScrollGridView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
		super.onMeasure(widthMeasureSpec, expandSpec);
	}

}
